package com.example.demo.controller;

import com.example.demo.service.CSDNSpiderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author haohulala
 * @version 1.0
 * @description: 开启爬虫接口
 * @date 2023/4/15 17:40
 */
@Controller
public class ClientController {

    @Autowired
    private CSDNSpiderService csdnSpiderService;

    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        return "hello";
    }

    @RequestMapping("/start")
    @ResponseBody
    public String start() {
        csdnSpiderService.startSpider();
        return "start success";
    }


}
